export default (safe) => {
    return {
      searchBtn:false,
      emptyBtn: false,
      height: 'auto',
      index: true,
      align: 'center',
      headerAlign: 'center',
      border: true,
      stripe: true,
      searchMenuPosition: 'left',
      submitText:'提交并预览',
      addBtn: true,
      editBtn: false,
      delBtn: false, // 行内删除按钮
      viewBtn: false, // 行内查看按钮
      excelBtn: true, // 导出Excel按钮
      labelWidth: 200, // 弹出表单的标题的统一宽度
      menuType: 'button', // 操作菜单的按钮样式 button/icon/text/menu
      menuWidth: 300,
      column: [
        {
          label: '模版选择',
          prop: 'modules',
          span:24,
          type:'select',
          value:'fastgpt-universal',
          dicData:[
            {
              label:'通用模版(可完全自行配置AI属性和知识库)',
              value:'fastgpt-universal'
            },
            {
              label:'极简模版(已内置参数细节)',
              value:'fastgpt-simple'
            }
          ],
          change({value,form}){
            const variables = safe.findObject(safe.deploy_option.column, "variables");
            if(value === 'fastgpt-universal'){
              variables.display = true
            }else{
              variables.display = false
            }
          }
        },
        // {
        //     label: '技能图标',
        //     span:24,
        //     prop: 'avatar',
        //   },
        {
          label: '对话开场白',
          type: 'textarea',
          span:24,
          prop: 'prologue',
          placeholder:"每次对话开始前，发送一个初始内容。支持标准 Markdown 语法，可使用的额外标记:[快捷按键]:用户点击后可以直接发送该问题",
          value:''
        },
        {
           label: '参数变量',
           prop: 'variables',
           display: true,
           span:24,
           type: 'dynamic',
           children:{
              index: false,
              align: 'center',
              type: 'form',
              headerAlign: 'center',
              rowAdd: (done) => {
                done({
                  variateXx:{},
                  variateMaxlen:50,
                  variateKey:safe.randomHandle()
                });
              },
              rowDel: (row, done) => {
                done();
              },
              column:[
                {
                  label: '变量名',
                  prop: 'variateName',
                  value:'label'
                },
                {
                  label: '变量KEY',
                  prop: 'variateKey',
                },
                {
                  label: '必填',
                  prop: 'isRequired',
                  type:'radio',
                  value:1,
                  dicData:[
                    {
                      label:'是',
                      value:1
                    },
                    {
                      label:'否',
                      value:0
                    }
                  ]
                },
                {
                  label: '字段类型',
                  prop: 'variateType',
                  type:'select',
                  value:'wb',
                  dicData:[
                    {
                      label:'文本',
                      value:'wb'
                    },
                    {
                      label:'段落',
                      value:'dl'
                    },
                    {
                      label:'下拉选择',
                      value:'xlxz'
                    }
                  ],
                  control: (val, form) => {
                    if(val === 'wb'){
                      return {
                        variateMaxlen:{
                          display:true
                        },
                        variateXx:{
                          display:false
                        }
                      }
                    }else if(val === 'dl'){
                      return {
                        variateMaxlen:{
                          display:false
                        },
                        variateXx:{
                          display:false
                        }
                      }
                    }else{
                      return {
                        variateMaxlen:{
                          display:false
                        },
                        variateXx:{
                          display:true
                        }
                      }
                    }
                  }
                },
                {
                  label: '最大长度',
                  type:'number',
                  prop: 'variateMaxlen',
                },
                {
                  label: '选项',
                  prop: 'variateXx',
                  type: 'dynamic',
                  span:24,
                  children:{
                    index: false,
                    headerAlign: 'center',
                    rowAdd: (done) => {
                      done();
                    },
                    rowDel: (row, done) => {
                      done();
                    },
                    column:[
                      {
                        label: '值',
                        prop: 'variateXxOptions',
                      }
                    ]
                 }
                },
              ]
           }
        },
        {
            label: 'AI模型',
            prop: 'aiSettings',
            type:'select',
            span:24,
            dicData:[
                {
                    label:'ChatGLM3 (0 元/1k tokens)',
                    value:'ChatGLM3'
                }
            ]
        },
        {
            label: '提示词',
            type: 'textarea',
            span:24,
            prop: 'systemPrompt',
            value:''
        },
        {
            label: '关联知识库',
            prop: 'datasets',
            type:'select',
            multiple: true,
            span:24,
            dicData:[]
        },
      ]
    }
  }
  